home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib9 / v_11_02 / 1102126b < prev    next >
Encoding:
Text File  |  1995-11-01  |  475 b   |  31 lines

  1. // date2.cpp
  2.  
  3. #include "date2.h"
  4.  
  5. inline int isleap(int y)
  6.   {return y%4 == 0 && y%100 != 0 || y%400 == 0;}
  7.  
  8. static int Dtab [2][13] =
  9. {
  10.   {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
  11.   {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
  12. };
  13.  
  14. Date * Date::interval(const Date& d2)
  15. {
  16.     (same as in Listing 2)
  17. }
  18.  
  19. Date::Date()
  20. {
  21.     month = day = year = 0;
  22. }
  23.  
  24. Date::Date(int m, int d, int y)
  25. {
  26.     month = m;
  27.     day = d;
  28.     year = y;
  29. }
  30.  
  31.